package com.example.controller;

import com.example.service.AccountServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RestController
public class AccountController {
    @Autowired
    private AccountServiceImpl accountService;
    @PutMapping("/modifiedaccount/{userId}/{used}")
    public Boolean modifiedAccount(@PathVariable("userId") Long userId,
                                   @PathVariable("used") BigDecimal used) throws InterruptedException {
        int i = accountService.modifiedAccount(userId, used);
        if(i>0){
            return true;
        }else {
            return false;
        }
    }
}
